<?xml version="1.0" encoding="utf-8" ?>
<taskrunner name="detach.all" version="1.0" date="2008-06-19" maxthreads="1">

  <!-- checks installed version. -->

  <includes>
    <file name="vida.install.settings.xml" />
  </includes>

  <properties>
    
  </properties>


  <tasks>
    <task name="detach.basedata" typename="@SqlServerManagement.DetachDatabase">
      <parameters>
        <parameter name="server" value="${sqlserver.local.server}"/>
        <parameter name="userid" value="${sqlserver.local.userid}"/>
        <parameter name="password" value="${sqlserver.local.password}"/>
        <parameter name="name" value="${db.basedata.name}"/>
      </parameters>
    </task>

    <task name="detach.diagswdlrepository" typename="@SqlServerManagement.DetachDatabase">
      <parameters>
        <parameter name="server" value="${sqlserver.local.server}"/>
        <parameter name="userid" value="${sqlserver.local.userid}"/>
        <parameter name="password" value="${sqlserver.local.password}"/>
        <parameter name="name" value="${db.diagswdlrepository.name}"/>
      </parameters>
    </task>

    <task name="detach.servicerepository" typename="@SqlServerManagement.DetachDatabase">
      <parameters>
        <parameter name="server" value="${sqlserver.local.server}"/>
        <parameter name="userid" value="${sqlserver.local.userid}"/>
        <parameter name="password" value="${sqlserver.local.password}"/>
        <parameter name="name" value="${db.servicerepository.name}"/>
      </parameters>
    </task>

    <task name="detach.epc" typename="@SqlServerManagement.DetachDatabase">
      <parameters>
        <parameter name="server" value="${sqlserver.local.server}"/>
        <parameter name="userid" value="${sqlserver.local.userid}"/>
        <parameter name="password" value="${sqlserver.local.password}"/>
        <parameter name="name" value="${db.epc.name}"/>
      </parameters>
    </task>

    <task name="detach.imagerepository" typename="@SqlServerManagement.DetachDatabase">
      <parameters>
        <parameter name="server" value="${sqlserver.local.server}"/>
        <parameter name="userid" value="${sqlserver.local.userid}"/>
        <parameter name="password" value="${sqlserver.local.password}"/>
        <parameter name="name" value="${db.imagerepository.name}"/>
      </parameters>
    </task>

    <task name="detach.accessserver" typename="@SqlServerManagement.DetachDatabase">
      <parameters>
        <parameter name="server" value="${sqlserver.local.server}"/>
        <parameter name="userid" value="${sqlserver.local.userid}"/>
        <parameter name="password" value="${sqlserver.local.password}"/>
        <parameter name="name" value="${db.accessserver.name}"/>
      </parameters>
    </task>

    <task name="check.accessserver.files" typename="@FileExist">
      <description>
        kontrollerar om gamla databaser finns i vidasave katalogen
      </description>
      <dependencies list="detach.accessserver"/>
      <parameters>
        <parameter name="dir" value="${target.db.dir}"/>
        <parameter name="files" value="${db.accessserver.data.filename},${db.accessserver.log.filename}"/>
        <parameter name="output.value" value="accessserver.files.exists"/>
      </parameters>
    </task>



    

    <task name="copy.accessserver.mdf.to.vida.save" condition="¤{accessserver.files.exists}=true" typename="@FileCopy">
      <dependencies list="detach.accessserver,check.accessserver.files"/>
      <parameters>
        <parameter name="src" value="${target.db.dir}\${db.accessserver.data.filename}"/>
        <parameter name="dst" value="${target.vidasave.dir}\${db.accessserver.data.filename}"/>
      </parameters>
    </task>

    <task name="copy.accessserver.ldf.to.vida.save" condition="¤{accessserver.files.exists}=true" typename="@FileCopy">
      <dependencies list="detach.accessserver,check.accessserver.files"/>
      <parameters>
        <parameter name="src" value="${target.db.dir}\${db.accessserver.log.filename}"/>
        <parameter name="dst" value="${target.vidasave.dir}\${db.accessserver.log.filename}"/>
      </parameters>
    </task>


 
   

    <task name="detach.diagswdlsession" typename="@SqlServerManagement.DetachDatabase">
      <parameters>
        <parameter name="server" value="${sqlserver.local.server}"/>
        <parameter name="userid" value="${sqlserver.local.userid}"/>
        <parameter name="password" value="${sqlserver.local.password}"/>
        <parameter name="name" value="${db.diagswdlsession.name}"/>
      </parameters>
    </task>

    <task name="check.diagswdlsession.files" typename="@FileExist">
      <description>
        kontrollerar om gamla databaser finns i vidasave katalogen
      </description>
      <dependencies list="detach.diagswdlsession"/>
      <parameters>
        <parameter name="dir" value="${target.db.dir}"/>
        <parameter name="files" value="${db.diagswdlsession.data.filename},${db.diagswdlsession.log.filename}"/>
        <parameter name="output.value" value="diagswdlsession.files.exists"/>
      </parameters>
    </task>

    <task name="copy.diagswdlsession.mdf.to.vida.save" condition="¤{diagswdlsession.files.exists}=true" typename="@FileCopy">
      <dependencies list="detach.diagswdlsession,check.diagswdlsession.files"/>
      <parameters>
        <parameter name="src" value="${target.db.dir}\${db.diagswdlsession.data.filename}"/>
        <parameter name="dst" value="${target.vidasave.dir}\${db.diagswdlsession.data.filename}"/>
      </parameters>
    </task>

    <task name="copy.diagswdlsession.ldf.to.vida.save" condition="¤{diagswdlsession.files.exists}=true" typename="@FileCopy">
      <dependencies list="detach.diagswdlsession,check.diagswdlsession.files"/>
      <parameters>
        <parameter name="src" value="${target.db.dir}\${db.diagswdlsession.log.filename}"/>
        <parameter name="dst" value="${target.vidasave.dir}\${db.diagswdlsession.log.filename}"/>
      </parameters>
    </task>


  </tasks>

</taskrunner>